<template>
	<view class="page-person">
		<u-navbar title="个人中心" :safeAreaInsetTop="true">
			<view slot="left"></view>
		</u-navbar>
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
			<view class="u-m-r-10">
				<u-avatar :src="pic" size="80"></u-avatar>
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20">多哈</view>
				<view class="u-font-14 u-tips-color">账号:13035121118</view>
			</view>
			<!-- <view class="u-m-l-10 u-p-10">
				<u-icon name="scan" color="#969799" size="28"></u-icon>
			</view> -->
			<view class="u-m-l-10 u-p-10">
				<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
			</view>
		</view>
		<u-gap height="10" bgColor="#fafafa"></u-gap>
		<u-cell title="我的订单" url="/pages/ucenter/order">
			<u-icon slot="right-icon" name="arrow-right"></u-icon>
		</u-cell>
		<u-grid :border="false" col="5">
			<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex" @click="clickItem()">
					<u-badge type="error" max="99" :value="listIndex+1" :offset="offsetIcon" :absolute="true"></u-badge>
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="listItem.name" :size="30"></u-icon>
					<text class="u-font-14 u-p-b-30">{{listItem.title}}</text>
			</u-grid-item>
		</u-grid>
		<u-gap height="10" bgColor="#fafafa"></u-gap>
		<u-cell-group :border="false" >
			<u-cell icon="setting" title="个人设置">
				<u-icon slot="right-icon" name="arrow-right"></u-icon>
			</u-cell>
			<u-cell icon="coupon" title="我的优惠劵">
				<u-icon slot="right-icon" name="arrow-right"></u-icon>
			</u-cell>
			<u-cell icon="map" title="收货地址" url="/pages/address/index">
				<u-icon slot="right-icon" name="arrow-right"></u-icon>
			</u-cell>
		</u-cell-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pic: 'https://uviewui.com/common/logo.png',
				show: true,
				offsetIcon:[8,10],
				list:[{
						name: 'photo',
						title: '待付款'
					},
					{
						name: 'lock',
						title: '待发货'
					},
					{
						name: 'star',
						title: '已发货'
					},
					{
						name: 'hourglass',
						title: '已完成'
					},
					{
						name: 'home',
						title: '已关闭'
					},
				]
			}
		},
		onLoad() {

		},
		methods: {
			gotoPage(url){
				uni.$u.route('/pages/' + url);
			},
			clickItem(){
				this.gotoPage("ucenter/order")
			}
		}
	}
</script>

<style lang="scss">
	.page-person{
		.user-box {
			background-color: #fff;
		}
		.u-grid-item{
			position: relative;	
		}
	}
	
</style>
